try datetime python

117

try datetime python -

try:
    d = datetime.datetime.strptime(s, "%Y-%m-%d %H:%M:%S")
except ValueError:
    d = None

Comments

Submit
0 Comments